package demo03;

import java.util.Arrays;
import java.util.Random;

public class work4 {
	public static void main(String[] args){
		Random r=new Random();
		int temp=0;
		int[][]arr={{1,2},{3,4,5,6},{7,8,9,10}};
		for(int i=0;i<arr.length;i++){
			int x1=r.nextInt(arr.length),x2=r.nextInt(arr.length);
			for(int j=0;j<arr[i].length;j++){
				int y1=r.nextInt(arr[x1].length),y2=r.nextInt(arr[x2].length);
				temp=arr[x1][y1];
				arr[x1][y1]=arr[x2][y2];
				arr[x2][y2]=temp;
			}
		}
		for(int i=0;i<arr.length;i++){
			System.out.println(Arrays.toString(arr[i]));
		}
		
	}
}
